-- GENERATED SPELL FOR [Druid of the Fang] --


function spell0_3840(pUnit, Event) --@Druid\'s Slumber,n/a--
pUnit:FullCastSpellOnTarget(8040,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_3840', 17500, 1)
end

function spell1_3840(pUnit, Event) --@Healing Touch,Heal--
pUnit:FullCastSpellOnTarget(5187,pUnit)
pUnit:RegisterEvent('Sorts_3840', 2500, 1)
end

function spell2_3840(pUnit, Event) --@Lightning Bolt,n/a--
pUnit:FullCastSpellOnTarget(9532,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_3840', 3000, 1)
end

function spell3_3840(pUnit, Event) --@Serpent Form,Self--
pUnit:FullCastSpellOnTarget(8041,pUnit)
pUnit:RegisterEvent('Sorts_3840', 10336, 1)
end

function Sorts_3840(pUnit, Event)
local choix_sorts_3840 = math.random(0, 3)
if choix_sorts_3840 == 0 then
pUnit:RegisterEvent('spell0_3840', 1, 1)
end
if choix_sorts_3840 == 1 then
pUnit:RegisterEvent('spell1_3840', 1, 1)
end
if choix_sorts_3840 == 2 then
pUnit:RegisterEvent('spell2_3840', 1, 1)
end
if choix_sorts_3840 == 3 then
pUnit:RegisterEvent('spell3_3840', 1, 1)
end
end

function mob3840_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_3840', math.random(1500, 3000), 1)
end

function mob3840_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob3840_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob3840_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(3840, 1, 'mob3840_Action')
RegisterUnitEvent(3840, 2, 'mob3840_Leave')
RegisterUnitEvent(3840, 3, 'mob3840_Kill')
RegisterUnitEvent(3840, 4, 'mob3840_Die')
